#!/bin/bash

#=============集群初始化,下面的操作只需要在master节点上执行即可 =============#

# init
kubeadm init --image-repository registry.aliyuncs.com/google_containers --pod-network-cidr 10.244.0.0/16

#创建必要文件
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config

#安装网络插件
kubectl apply -f ./kube-flannel.yml

# 加入node
chmod +x ./cmd.sh 
./cmd.sh jointoken

echo '=================Now To Do Following Task=================='
echo '1:NFS Install'
echo '2:Dashboard Install'
echo '3:Enable K8S API'
echo '4:Enable Docker API (For Mirror Docker Image Push)'
echo '5:SSH Without Password (For Persistent Volume Create/Copy)'
echo '6:Jupyter Install'
